package com.ccp.dev.demo.model;

import com.ccp.dev.core.basic.model.BaseModel;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.Objects;

/**
 * 示例工程实体
 * @author xxx
 * @date 20xx.xx.xx
 */

@Component
public class Demo extends BaseModel {
    //示例ID
    private String demoId;
    //示例名称
    private String demoName;
    //示例类型
    private int demoType;
    //示例时间
    private Date demoTime;

    public String getDemoId() {
        return demoId;
    }

    public void setDemoId(String demoId) {
        this.demoId = demoId;
    }

    public String getDemoName() {
        return demoName;
    }

    public void setDemoName(String demoName) {
        this.demoName = demoName;
    }

    public int getDemoType() {
        return demoType;
    }

    public void setDemoType(int demoType) {
        this.demoType = demoType;
    }

    public Date getDemoTime() {
        return demoTime;
    }

    public void setDemoTime(Date demoTime) {
        this.demoTime = demoTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Demo demo = (Demo) o;
        return demoType == demo.demoType &&
                Objects.equals(demoId, demo.demoId) &&
                Objects.equals(demoName, demo.demoName) &&
                Objects.equals(demoTime, demo.demoTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(demoId, demoName, demoType, demoTime);
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("demoId", demoId)
                .append("demoName", demoName)
                .append("demoType", demoType)
                .append("demoTime", demoTime)
                .toString();
    }
}
